<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *用户表
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('账号昵称')->nullable();
	        $table->string('avator')->comment('用户头像')->nullable();
	        $table->string('realname')->comment('真实姓名')->nullable();
	        $table->string('phone')->comment('联系方式')->nullable();
            $table->string('email')->nullable();
            $table->string('password')->default(bcrypt('123456'));
	        $table->string('status')->comment('状态：1有效，0无效')->default(1);
	        $table->integer('company_id')->comment('所属公司id')->nullable();

	        $table->tinyInteger('type')->comment('人员类型:1全职，0兼职')->nullable();
	        $table->string('contract_number')->comment('合同编号')->nullable();
	        $table->string('address')->comment('联系地址')->nullable();
	        $table->tinyInteger('department')->comment('配置部门')->nullable();
	        $table->tinyInteger('station')->comment('配置岗位')->nullable();
	        $table->string('card')->comment('银行卡号')->nullable();
	        $table->string('opening_bank')->comment('开户行')->nullable();
	        $table->integer('is_manage')->comment('人员类别：1门店人员，2管理人员，3店长')->nullable();
	        $table->integer('task_status')->comment('任务状态：1空闲，2等待排班，3任务中，4管理人员')->nullable();

	        $table->integer('job')->comment('在职状态：1在职，2离职')->nullable();

            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
